
do "E:/ReplicateBuild/02_code/00_environment/00_set_environment.do"


********************************************************************************
* ANALYSIS (can be run in any order)
********************************************************************************

* calculate rates of persistent disadvantage
* creates Appendix Table 19
do "$code/02_analysis/calculate_persistentDISAD_rates.do"

* calculate within-school segregation statistics
* creates Appendix Table 3
do "$code/02_analysis/decompose_segregation_schools_classrooms.do"

* estimate difference between potential VA and actual VA for principal ratings
* creates Appendix Table 24
do "$code/02_analysis/estimate_cost_of_hiring_mistakes.do"

* estimate unconditional and conditional application rates for two-vacancy schools
* creates Appendix Table 6
do "$code/02_analysis/estimate_rate_of_multiapp_per_school.do"
 
* estimate teacher variation in student type and school mean VA by student type
* creates Appendix Figures 1, 7
do "$code/02_analysis/estimate_teacher_variation_in_student_type.do"
 
* estimate vacancy posting patterns across schools
* creates Appendix Tables 11, 12, Appendix Figures 2, 3
do "$code/02_analysis/estimate_vacancy_posting_patterns.do"

* estimate prevalence of teachers having multiple classrooms
* creates Appendix Table 29
do "$code/02_analysis/assess_multi_classrooms.do"

* estimate pseudo R2s from princpal rating model
* creates Appendix Table 14
do "$code/02_analysis/logit_R2s_w_evaas.do"

* estimate statistics from principal decisions
* creates Appendix Tables 2, 4, 5, 8, 10
do "$code/02_analysis/principal_evaluations.do"

* create summary statistics based on sample
* creates Appendix Table 1
do "$code/02_analysis/sample_selection_table.do"

* show properties of the current allocation, with different cuts
* creates Table 3, Appendix Tables 16, 17, 18, 20, 21
do "$code/02_analysis/summary_stats_sass_diffmeas.do"

* show properties of the transfer sample
* creates Appendix Table 28
do "$code/02_analysis/transf_samp.do"

* create many descriptive analyses about timing of applications and vacancies
* creates Figure 1, Appendix Tables 7, 8
do "$code/02_analysis/tablesfigures_analysis.do"

* regress value-added on teacher characteristics
* creates Appendix Table 15
do "$code/02_analysis/vam_by_characteristics.do"


********************************************************************************
* ANALYSIS THAT MUST RUN MATLAB IN THE MIDDLE
********************************************************************************

* create analyses related to product model
* creates Appendix Tables 13, 22, 30, 31, Appendix Figures 4, 5
do "$code/02_analysis/production_section_tables.do"

********************************************************************************
* ANALYSIS THAT MUST BE RUN BEFORE MATLAB
********************************************************************************

* estimate binary logits that get read in to matlab
do "$code/02_analysis/binary_logits.do"

* estimate ordered logits that get read in to matlab
do "$code/02_analysis/ordered_logits.do"

********************************************************************************
* ANALYSIS THAT MUST BE RUN AFTER MATLAB
********************************************************************************

* read in preference/rating estimates and create tables
* creates Tables 1, 2
do "$code/02_analysis/preference_estimates_tables_wide.do"
